package com.xue.web.service;

import com.alibaba.fastjson.JSONObject;
import com.xue.web.dao.LeaveMessageDao;
import com.xue.web.entity.LeaveMessage;

public class SendMessageService {
    public JSONObject doSendMessage(String user ,String message){
        JSONObject jsonObject =new JSONObject();
        LeaveMessageDao leaveMessageDao =new LeaveMessageDao();
        boolean insertMessage = leaveMessageDao.insertMessage(user, message);
        if (insertMessage){
            jsonObject.put("code",200);
            jsonObject.put("msg","发送成功");
            return jsonObject;
        }
        jsonObject.put("code",400);
        jsonObject.put("msg","发送失败");

        return jsonObject;
    }
}
